

EFFECT.Mat = Material( "effects/select_ring" )

/*---------------------------------------------------------
   Initializes the effect. The data is a table of data 
   which was passed from the server.
---------------------------------------------------------*/
function EFFECT:Init( data )
	local vOffset = data:GetOrigin()
	local Low = vOffset - Vector(32, 32, 32 )
	local High = vOffset + Vector(32, 32, 32 )
	local emitter = ParticleEmitter( vOffset )
		for i=0, (200) do
		
			local Pos = Vector(math.Rand(-1,1), math.Rand(-1,1), 0):GetNormalized()
			local particle = emitter:Add( "particles/flamelet"..math.random(1,5), vOffset + Pos)
			if (particle) then
				particle:SetVelocity( Pos * 2000)
				particle:SetLifeTime( 0 )
				particle:SetDieTime(math.Rand(4,6))
				particle:SetStartAlpha( math.Rand( 200, 255 ) )
				particle:SetEndAlpha( 0 )
				particle:SetStartSize( 200 )
				particle:SetEndSize( 200 )
				particle:SetRoll( math.Rand(0, 360) )
				particle:SetColor( 100, 100, 255 )
			end
		end
		for i=0, (200) do
		
			local Pos = Vector(0, math.Rand(-1,1), math.Rand(-1,1)):GetNormalized()
			local particle = emitter:Add( "particles/flamelet"..math.random(1,5), vOffset + Pos)
			if (particle) then
				particle:SetVelocity( Pos * 2000)
				particle:SetLifeTime( 0 )
				particle:SetDieTime(math.Rand(4,6))
				particle:SetStartAlpha( math.Rand( 200, 255 ) )
				particle:SetEndAlpha( 0 )
				particle:SetStartSize( 200 )
				particle:SetEndSize( 200 )
				particle:SetRoll( math.Rand(0, 360) )
				particle:SetColor( 100, 100, 255 )
			end
		end
		for i=0, (200) do
		
			local Pos = Vector(math.Rand(-1,1), 0, math.Rand(-1,1)):GetNormalized()
			local particle = emitter:Add( "particles/flamelet"..math.random(1,5), vOffset + Pos)
			if (particle) then
				particle:SetVelocity( Pos * 2000)
				particle:SetLifeTime( 0 )
				particle:SetDieTime(math.Rand(4,6))
				particle:SetStartAlpha( math.Rand( 200, 255 ) )
				particle:SetEndAlpha( 0 )
				particle:SetStartSize( 200 )
				particle:SetEndSize( 200 )
				particle:SetRoll( math.Rand(0, 360) )
				particle:SetColor( 100, 100, 255 )
			end
		end
		

	emitter:Finish()
	
end


/*---------------------------------------------------------
   THINK
---------------------------------------------------------*/
function EFFECT:Think( )

	return false
end

/*---------------------------------------------------------
   Draw the effect
---------------------------------------------------------*/
function EFFECT:Render()
end
